Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against @subqueries being empty #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pivotalneutron
Copy link

For queries without subqueries (ie: UPDATE), calling SqlQuery#table raises a
NoMethodError, since @subqueries is an empty array and [].first returns nil.
This happens if such a query triggers a warning (see SqlQuery#warn).

(We wanted to include a unit test, but they don't seem to be in working order.)

Arzumy MD & Mike Mazur added 2 commits May 5, 2011 17:41
For queries without subqueries (ie: UPDATE), calling SqlQuery#table raises a
NoMethodError, since @subqueries is an empty array and [].first returns nil.
This happens if such a query triggers a warning (see SqlQuery#warn).
jdelStrother pushed a commit to jdelStrother/query_reviewer that referenced this pull request Sep 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant